<!DOCTYPE html>
<!-- 引入thymeleaf标签，指定前缀 -->
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>Hello</title>
</head>
<body>
    <!-- 使用th标签，将作用域中的内容替换标签内容，完成页面的动态渲染 -->
    欢迎您，<span th:text="${user.usrName}">usrName</span>！
    <hr>
    <span th:text="'1.字符串拼接 Hello '+${user.usrName}">usrName</span>
    <br />
    <span th:text="|2.字符串模板 Hello ${user.usrName}|">usrName</span>
    <br />
    <div th:inline="text">
        <p>3.内联字符串 Hello [[${user.usrName}]]</p>
        <br />
    </div>
    <hr>
    <span th:text="|4.字符串模板 Hello ${test}|">usrName</span>
    <br />
    <span th:text="|5.字符串模板 Hello ${session.test}|">usrName</span>
    <br />
    <div th:object="${user}">
        <span th:text="*{usrId}">usrId</span>
        <span th:text="*{usrName}">usrName</span>
        <span th:if="*{usrFlag==1}">启用</span>
        <span th:unless="*{usrFlag==1}">停用</span>
    </div>
    <br />
    <div th:switch="${sex}">
        <p th:case="'woman'">她是一个姑娘...</p>
        <p th:case="'man'">这是一个爷们!</p>
        <!-- *: case 的默认的选项 -->
        <p th:case="*">未知性别的一个家伙。</p>
     </div>
    <div th:insert="layout/footer :: copyright"></div>
    <div th:replace="layout/footer :: copyright"></div>

    <script th:inline="javascript">
        var msg = `Hello ` + `[[${user.usrName}]]`;
        console.log('JavaScript中使用内联字符串 ' + msg);
    </script>
</body>
</html>